import Vue from 'vue'
import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
// 使用自定义主题
import '@/style/theme/index.css';
import '@/style/index.less'
import echarts from 'echarts'
import App from './App.vue'
import router from './router'
import store from './store'
import './permission' // permission control
import SvgIcon from '@/modules/index/icons'

SvgIcon(Vue)

import * as $common from '@/utils/common';

Vue.prototype.$common = $common;

import * as $regex from '@/utils/regex';

Vue.prototype.$regex = $regex;

import * as $webview2 from '@/modules/index/utils/webview2.js';
import * as $qwebUtil from '@/modules/index/utils/qwebUtil.js'

Vue.prototype.$webview2 = $webview2
Vue.prototype.$qwebUtil = $qwebUtil

/**
 * qt 测试代码部分
 * 将实例化后获得的 sendObject 挂载到全局上
 * 然后在每次调用接口的地方利用 sendObject 对象发请求
 */
// import { QWebChannel } from "@/modules/index/utils/qwebchannel.js";
// if ($qwebUtil.isQtClient) {
//     new QWebChannel(
//         window.qt.webChannelTransport,
//         function (channel) {
//             window.sendObject = channel.objects.sendObject;
//         }
//     );
// }

// mine-components组件注册
import '@/components/index.js';
// code-mirror注册
import 'codemirror/lib/codemirror.css'
import 'codemirror/theme/eclipse.css'
// import 'codemirror/mode/te'

import AudioRecorder from 'vue-audio-recorder';

Vue.use(AudioRecorder);
import VCharts from 'v-charts'

Vue.use(VCharts);
import VueClipboard from 'vue-clipboard2';

VueClipboard.config.autoSetContainer = true;
Vue.use(VueClipboard);

Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.prototype.$echarts = echarts

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
